package cn.tedu;

/**
 * @author guojiusan
 * @create 2022-04-03-15:41
 **/
public class TestDemo3 {
    public static void main(String[] args) {
        // for循环 重复执行的代码
//        for (int i = 0; i <3 ;   i++) {
//            开始条件    循环条件  更改条件
     //   System.out.println();循环体
//        }
        //从0到10打印在控制台  8,88,888,8888,
        for (int i = 0; i <=10; i++) {
            System.out.print(i+",");
        }
        System.out.println();
        for (int i = 8; i < 10000; i=i*10+8) {
            System.out.print(i+",");
        }
        System.out.println();
        // 嵌套ifor
        for (int i = 1; i <=9 ; i++) {
            for (int j = 1; j <=i ; j++) {
                System.out.print("*");
            }
            System.out.println(" ");
        }
       // 打印正角三角形
        for (int i = 0; i < 5; i++) {
            for (int j = 5; j>=i; j--) {
                System.out.print(" ");
            }
            for (int j = 0; j<=i ; j++) {
                System.out.print("*");
            }
            for (int j = 0; j<i; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }
}
